package model.objects;

import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.util.Random;

import model.general.LoadImage;
import model.general.Location;
import model.general.Util;
import model.move.IMove;

public abstract class Sprites {

	protected Location location;
	protected String srcImgLeft;
	protected String srcImgRight;
	protected String srcImgUp;
	protected BufferedImage img;
	protected Rectangle rect;
	protected LoadImage loadImage = new LoadImage();
	protected int width = Util.DEFAULT_WIDTH, height = Util.DEFAULT_HEIGHT;
	protected IMove move;
	protected int widthPanel = Util.DEFAULT_WIDTH_PANEL;
	protected int heightPanel = Util.DEFAULT_HEIGHT_PANEL;
	protected int minX = 0;
	protected int maxX = Util.DEFAULT_WIDTH_PANEL;
	protected BufferedImage imgLeft, imgRight;
	protected Random rand = new Random();

	public Sprites(){
		
	}
	
	protected Sprites(Location location, String[] srcImg) {
		this.location = location;
		this.srcImgLeft = srcImg[0];
		this.srcImgRight = srcImg[1];
		this.srcImgUp = srcImg[2];
		this.img = loadImage.getbufferImage(srcImgLeft);
		this.width = img.getWidth();
		this.height = img.getHeight();
		imgLeft = loadImage.getbufferImage(srcImgLeft);
		imgRight = loadImage.getbufferImage(srcImgRight);
		rect = new Rectangle(this.location.getX(), this.location.getY(), width,
				height);
	}

	public Rectangle getBounds() {
		rect = new Rectangle(this.location.getX(), this.location.getY(), width,
				height);
		return rect;
	}

}
